package mongodb

import "gopkg.in/mgo.v2/bson"

type PCameraZone struct {
	Recerse      int    `bson:"Reverse"`
	CameraZoneId string `bson:"CameraZoneId"`
}

type PhysicalZone struct {
	Id           string        `bson:"Id"`
	MallName     string        `bson:"MallName"`
	Name         string        `bson:"Name"`
	ZoneTypeName string        `bson:"ZoneTypeName"`
	Enabled      int           `bson:"Enabled"`
	CameraZones  []PCameraZone `bson:"CameraZones"`
}

func (connect *Connect) FindPhysicalZoneByMallName(mallName string) (*[]PhysicalZone, error) {
	c := connect.DataBase.C("D_PhysicalZone")
	var result []PhysicalZone
	err := c.Find(bson.M{"MallName": mallName}).All(&result)
	return &result, err
}
